package cate.game.event.worldtree;

import cate.game.event.GameEventListener;

public class ShareLevelChangeListener implements GameEventListener<ShareLevelChangeEvent> {

    @Override
    public void onEvent(ShareLevelChangeEvent gameEvent) {
        gameEvent.role.getHistory().action.worldtreeLevel(gameEvent.newLevel);
        gameEvent.role.getFarm().spiceFb.checkOpen();
        if(gameEvent.role.getFarm().spiceFb.isOpen()){
            gameEvent.role.getFarm().spiceFb.checkUnLock();
        }
        if (gameEvent.role.getRes().magicContract.isOpen()) {
            gameEvent.role.getRes().magicContract.updateMap(gameEvent.newLevel);
        }
    }
}
